import Vue from 'vue'
import Vuex from 'vuex'
import axios from "axios"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    yonghuList:[],
  },
  mutations: {
    YONGHUlist(state,item){
      state.yonghuList= item
    }
  },
  actions: {
    YONGHUlist(context){
      axios.get('./shopList.json').then((res)=>{
        console.log(res.data);
        context.commit('YONGHUlist',res.data)
      }).catch((err)=>{
        console.log(err);
      })
    }
  },
  modules: {
  }
})
